home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Workbench Add-On
/
Workbench Add-On - Volume 1.iso
/
BBS-Archive
/
Dev
/
Obrn-A_1.6_lib.lha
/
oberon-a
/
source3.lha
/
source
/
3rdParty
/
IntuiSupUtil.mod
< prev
next >
Wrap
Text File
|
1995-06-29
|
4KB
|
157 lines
(*************************************************************************
$RCSfile: IntuiSupUtil.mod $
Description: Support for clients of intuisup.library.
Created by: fjc (Frank Copeland)
$Revision: 2.9 $
$Author: fjc $
$Date: 1995/06/04 23:11:42 $
Copyright © 1994-1995, Frank Copeland.
This file is part of the Oberon-A Library.
See Oberon-A.doc for conditions of use and distribution.
*************************************************************************)
<* STANDARD- *>
MODULE IntuiSupUtil;
IMPORT SYS := SYSTEM, e := Exec, i := Intuition, is := IntuiSup;
(*------------------------------------------------------------------------*)
(* Procedures for Gadgets *)
CONST
disableFlag = {is.gdDisabled};
noFlag = {};
(*------------------------------------------------------------------------*)
(* Procedures for AutoRequesters *)
CONST
noIDCMPFlags = {};
autoReqFlags = {is.arMovePointerNeg, is.arDrawRaster};
acceptText = "Accept";
cancelText = "Cancel";
continueText = "Continue";
(*------------------------------------------------------------------------*)
(* Procedures for Gadgets *)
(*------------------------------------*)
PROCEDURE DisableGadget *
( gadgetList : is.GadgetList;
gadget : INTEGER;
disableIt : BOOLEAN);
VAR ignore : LONGINT;
BEGIN (* DisableGadget *)
IF disableIt THEN
ignore :=
is.SetGadgetAttributes (
gadgetList, gadget, disableFlag, disableFlag,
is.useCurrentValue, is.useCurrentValue,
is.useCurrentValue);
ELSE
ignore :=
is.SetGadgetAttributes (
gadgetList, gadget, disableFlag, noFlag,
is.useCurrentValue, is.useCurrentValue,
is.useCurrentValue);
END; (* ELSE *)
END DisableGadget;
(*------------------------------------*)
PROCEDURE SelectGadget *
( gadgetList : is.GadgetList;
gadget : INTEGER;
selectIt : BOOLEAN);
VAR ignore, value : LONGINT;
BEGIN (* SelectGadget *)
IF selectIt THEN value := 1 ELSE value := 0 END;
ignore :=
is.SetGadgetAttributes (
gadgetList, gadget, noFlag, noFlag, value, is.useCurrentValue,
is.useCurrentValue);
END SelectGadget;
(*------------------------------------*)
PROCEDURE SetGadget *
( gadgetList : is.GadgetList;
gadget : INTEGER;
gadgetType : INTEGER;
value : LONGINT);
VAR ignore : LONGINT;
BEGIN (* SetGadget *)
CASE gadgetType OF
is.button, is.check :
ignore :=
is.SetGadgetAttributes
( gadgetList, gadget, noFlag, noFlag, value, is.useCurrentValue,
is.useCurrentValue);
|
is.mx, is.cycle :
ignore :=
is.SetGadgetAttributes
( gadgetList, gadget, noFlag, noFlag, is.useCurrentValue, value,
is.useCurrentValue);
|
ELSE
ignore :=
is.SetGadgetAttributes
( gadgetList, gadget, noFlag, noFlag, is.useCurrentValue,
is.useCurrentValue, value);
END; (* CASE gadgetType *)
END SetGadget;
(*------------------------------------------------------------------------*)
(* Procedures for AutoRequesters *)
(*------------------------------------*)
PROCEDURE DoRequest *
( reqWin : i.WindowPtr;
title : e.LSTRPTR;
bodyText : ARRAY OF CHAR )
: BOOLEAN;
<*$CopyArrays-*>
BEGIN (* DoRequest *)
RETURN
is.AutoRequest
( reqWin, title, bodyText, SYS.ADR(acceptText), SYS.ADR(cancelText),
noIDCMPFlags, noIDCMPFlags, autoReqFlags, NIL);
END DoRequest;
(*------------------------------------*)
PROCEDURE DoNotice *
( reqWin : i.WindowPtr;
title : e.LSTRPTR;
bodyText : ARRAY OF CHAR );
VAR ignore : BOOLEAN;
<*$CopyArrays-*>
BEGIN (* DoNotice *)
ignore :=
is.AutoRequest
( reqWin, title, bodyText, NIL, SYS.ADR(continueText), noIDCMPFlags,
noIDCMPFlags, autoReqFlags, NIL);
END DoNotice;
END IntuiSupUtil.